#pragma once
#include <stdint.h>
#include <string.h>

#include "data_define.h"

typedef enum {
  PARSE_OK = 0,
  PARSE_INVALID_JSON,
  PARSE_MISSING_FIELD,
  PARSE_TYPE_MISMATCH,
  PARSE_NO_MY_DEVICE,

} parse_result_e;
void make_register_pack(char *buf, g_cfg_t *cfg);
parse_result_e parse_regiser_ack_pack(char *buf);
// parse_result_e parse_sync_pack(char *buf, g_cfg_t *out_cfg);
void make_sycn_ack_pack(char *buf);
void make_realtime_pack(char *buf, float H, float T, uint32_t timestamp);
// uint8_t parse_real_time_ack_pack(char *buf);

parse_result_e parse_json_pack(char *buf, g_cfg_t *out_cfg);